package com.ruoyi.stock2.utils;

import java.io.Serializable;
import java.math.BigDecimal;


public class NameAndValue implements Comparable<NameAndValue>, Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String name;
	
	private BigDecimal value;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public BigDecimal getValue() {
		return value;
	}
	public void setValue(BigDecimal value) {
		this.value = value;
	}
	public NameAndValue(String name, BigDecimal value) {
		super();
		this.name = name;
		this.value = value;
	}
	public NameAndValue() {
		super();
		// TODO Auto-generated constructor stub
	}
	@Override
	public int compareTo(NameAndValue o) {
		if(this.value.compareTo(o.getValue())<0){
			return 1;
		}else if(this.value.compareTo(o.getValue())>0){
			return -1;
		}else{
			return 0;
		}
	}
	@Override
	public String toString() {
		return "NameAndValue [name=" + name + ", value=" + value + "]";
	}
	
}
